<form class="form-horizontal" name="form" ng-submit="$vm.ok()" novalidate>
    <div class="modal-header bg-primary">
        <h3 class="modal-title">{{ $vm.dashboard.id ? 'Update dashboard' : 'New Dashboard' }}</h3>
    </div>
    <div class="modal-body">
        <div class="form-group">
            <label class="col-sm-2 control-label">
                Title
                <i class="fa fa-asterisk text-danger"></i>
            </label>
            <div class="col-sm-10">
                <input class="form-control" ng-model="$vm.dashboard.title" required>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-2 control-label">
                Description
                <i class="fa fa-asterisk text-danger"></i>
            </label>
            <div class="col-sm-10">
                <textarea class="form-control" ng-model="$vm.dashboard.description" rows="6" required></textarea>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-2 control-label">
                Visibility
                <i class="fa fa-asterisk text-danger"></i>
            </label>
            <div class="col-sm-10">
                <select class="form-control" ng-model="$vm.dashboard.status" ng-options="s for s in $vm.statuses" required>
                    <option value="">-- select an option --</option>
                </select>
            </div>
        </div>
    </div>
    <div class="modal-footer text-left">
        <button class="btn btn-default" ng-click="$vm.cancel()">Cancel</button>
        <button class="btn btn-primary pull-right" type="submit" ng-disabled="form.$invalid">{{ $vm.dashboard.id ? 'Update' : 'Create' }}</button>
    </div>
</form>
